<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="../css/reset.css">
    <style>
        .box {
            width: 300px;
            height: 300px;
            background-color: #f00;
            position: relative;
        }

        .hide {
            /* 1 画色块 */
            width: 300px;
            height: 200px;
            background-color: #ff0;


            /* 2 定位 */
            position: absolute;
            top: 0;
            

            text-align: center;
            line-height: 50px;
            color: red;



            /* 3 隐藏 */
            /* overflow: hidden;   超出才会隐藏 */

            height: 0;
            overflow: hidden;
            transition: .3s;
        }

        .box:hover .hide {
            height: 200px;
        }
    </style>
</head>

<body>

    <div class="nav">
        <div class="box">
            <div class="hide">购物车空空如也</div>
        </div>
    </div>

</body>

</html>